<?
require("config.php");
require("header.php");

$action = $_POST["action"];
if (NULL!=$action){

$contactusCode = $_POST["contactus_code"];
$sessionContactusCode = $_SESSION['contactus_num_check'];
if($contactusCode != $sessionContactusCode)
{
	echo "<script>alert('Verify code error!');history.back(-1);</script>";
	exit();
}

/*getMyParam("Name");
getMyParam("Email");
getMyParam("Company");
getMyParam("");
getMyParam("");*/


$from_name = $Name;
$from_email = $Email;

$to_name = "Acuity World";
$to_email = "info@acuityworld.com";

$subject = "Contact us";

$content = "
Name: $Name
Company: $Company
Tel: $Tel
Fax: $Fax
Email: $Email

Message: $Message

";




//sendmail($from_name,$from_email,$to_name,$to_email,$subject,$content);














//ʼԱ

$subject = "A message from $Name";

$Query = "select name, email from user_profile where alert02 = 'y'";
$r = myQuery($Query);

for ($i=0;$i<count($r);$i++){
    $to_name  = $r[$i][0];
    $to_email = $r[$i][1];

$content = "
<html>
<head>
<title>Acuity World</title>
<style type=\"text/css\">
<!--
body {
	font-family: \"Arial\";
	font-size: 12px;
}
td {
	font-family: \"Arial\";
	font-size: 12px;
}
-->
</style>
</head>
<body bgcolor=\"#FFFFFF\">

Dear $to_name<BR>

You have received a message from <BR><BR>

Name: $Name<BR>
Company: $Company<BR>
Tel: $Tel<BR>
Fax: $Fax<BR>
Email: $Email<BR>
Message: $Message<BR><BR>



<br>
Regards,<br><br>
Acuity World<br><br>
<a href=\"http://www.acuityworld.com\" target=\"_blank\">www.acuityworld.com</a>

</body>
</head>
</html>
";

sendhtmlmail($from_name,$from_email,$to_name,$to_email,$subject,$content);

}

}


?>












<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 

    <td width="186" valign="top"> 
      <?require("nav.php")?>
    </td>
    <td width="11"><img src="images/shim.gif" width="11" height="1"></td>
    <td valign="top"> 
      <?require("menu.php")?>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td align="right"><table width="100%" border="0">
              <tr> 
                <td height="50" class="header">&gt;&gt; Contact Us</td>
              </tr>
            </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td valign="top">Thank you !<br> <br>
            We will contact you soon. <br> <br> </td>
        </tr>
      </table>
      <br> <br> <br>
      <br> </td>
    <td width="11"><img src="images/shim.gif" width="11" height="1"></td>
    <td width="173" valign="top">
	
	
<?require("list.php")?>	 
	  
	  
    </td>

  </tr>
</table>





<?require("footer.php")?>	